#! /usr/bin/env python
from sqlite3 import dbapi2 as sqlite

conn = sqlite.connect("lotto-hist")
curs = conn.cursor()

curs.execute("select * from history order by date")
rows = curs.fetchall()
index = 0

for row in rows:
	curs.execute("insert into dates values (?,?)", (index,row[0],))
	index += 1
	conn.commit()
	
	